
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import {sendRouterBuriedPoint} from "/@/assets/js/globalMethods/globalBuriedPoint"
// 静态路由页面
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/login.vue"),
        meta: { title: '', icon: 'Eleme' }
    },    
    {
        path: '/login',
        name: 'login',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/login.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },
    {
        path: '/demo',
        name: 'demo',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/demo.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },
    {
        path: '/jump',
        name: 'jump',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/jump.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },{
        path: '/Information',
        name: 'Information',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/Information.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },{
        path: '/InformationList',
        name: 'InformationList',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/InformationList.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },
    {
        path: '/insure',
        name: 'insure',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/insure.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },
    {
        path: '/UserRegister',
        name: 'UserRegister',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/UserRegister.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    },
    {
        path: '/changPassword',
        name: 'changPassword',
        component: () =>
            import(/* webpackChunkName: "Empower" */ "/@/views/login/changPassword.vue"),
        meta: { title: '', icon: 'Eleme' }
        // 登录
    }
]

const router = createRouter({
    history: createWebHistory(""),
    // history: createWebHistory("/policyReviewH5/"),
    routes
})
router.beforeEach((to, from, next) => {
    sessionStorage.setItem("currentRouter", to.name as any);
    sendRouterBuriedPoint(to.name as any)
    if(from.path == "/reportingResultwxts"){
        return
    }
    if(to.meta.title) {
        document.title = to.meta.title as any
    } 
    next()
   
})
export default router